# Copyright 2018 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
from odoo.addons import decimal_precision as dp
from odoo.tools.float_utils import float_compare, float_round
import logging


_logger = logging.getLogger(__name__)


class pro_template(models.Model):
    _inherit = "product.template"

    material = fields.One2many('pro.material', 'template', u'客户物料信息')
    alias_name = fields.Char(u'对外物料名称')
    alias_code = fields.Char(u'对外物料编码')
    tong = fields.Boolean(string=u'桶', default=False)


class pro_material(models.Model):
    _name = 'pro.material'

    pro_code = fields.Char(u'客户物料编码')
    pro_name = fields.Char(u'客户物料名称')
    pro = fields.Many2one('res.partner', u'客户')
    template = fields.Many2one('product.template')
